package com.rtmart.imageupload.repository;

import com.rtmart.imageupload.entity.User;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Modifying;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.query.Param;
import org.springframework.stereotype.Repository;
/**
 * @author Copyright ©2018 贾维程. All rights reserved.
 */
@Repository
public interface UserRepository{

    User findById(Long id);

    User findByUsername(String username);

    Integer updateUser(String name, User user);

    Integer updatePassword(String password, User user);

    //@Modifying
   //@Query(value = "update User u set u.username=?1,enable=?2 where id=?3",nativeQuery = true)
    //Integer updateUser(User user);
}
